@echo off
setlocal
call "C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\bin\vcvars32.bat">nul 2>nul
call "C:\Program Files\Microsoft Visual Studio 10.0\VC\bin\vcvars32.bat">nul 2>nul

cd /d %~dp0

set TEMP_BUILD_LOG=BuildLog.txt
Echo Building Picture Arranger
rd /S /Q obj>nul 2>nul
rd /S /Q bin>nul 2>nul

msbuild /p:configuration=Release PhotoArrangerDateWise.sln >%TEMP_BUILD_LOG%
if errorlevel 1 (
	echo Failed to build Picture Arranger in Release Mode.
	type %TEMP_BUILD_LOG%
	if not defined NOPAUSE pause
	exit /b 1
)

Echo Cleaning Up Temporary files


del .\bin\Release\PictureArrangerDateWise.exp>nul 2>nul
del .\bin\Release\PictureArrangerDateWise.ilk>nul 2>nul
del .\bin\Release\PictureArrangerDateWise.lib>nul 2>nul
del .\bin\Release\PictureArrangerDateWise.pdb>nul 2>nul
del .\bin\Release\PictureArrangerDateWise.exe.config>nul 2>nul
del .\bin\Release\PictureArrangerDateWise.vshost.exe>nul 2>nul
del .\bin\Release\PictureArrangerDateWise.vshost.xe.xml>nul 2>nul
del .\bin\Release\PictureArrangerDateWise.vshost.exe.config>nul 2>nul
del .\bin\Release\PictureArrangerDateWise.vshost.exe.manifest>nul 2>nul

del %TEMP_BUILD_LOG%>nul 2>nul

rd /S /Q obj>nul 2>nul
rd /S /Q bin\debug>nul 2>nul
Echo Completed Building PictureArrangerDateWise
if not defined NOPAUSE pause


